<?php

class Application_Form_Registry extends Zend_Form {

   protected function description() {
      $description = new Zend_Form_Element_Textarea('description');
      $description->setLabel('Description')
			->setRequired(true)
			->addFilter('StringTrim')
         ->setAttrib('rows', 10)
         ->setAttrib('class', 'ckeditor')
         ->setDecorators(array(
            'ViewHelper',
            'Description',
            'Errors',
            array('HtmlTag', ''),
            array('Label', ''),
         ));
      $this->addElement($description);
   }
   
   public function init() {
      $this->setName('registry');
      
      $id = new Zend_Form_Element_Hidden('id');
      $id->addFilter('Int');
      
      $this->addElement($id);
      
      $this->description();
      
      $submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')
			->setLabel('Save')
         ->setAttrib('class', 'btn btn-primary');
      $this->addElement($submit);
      
      $this->addDisplayGroup(array('submit'), 'form_actions', array(
          'decorators' => array(
            'FormElements',
            'Fieldset',
            array('HtmlTag', array('tag' => 'div', 'class' => 'form-actions'))
          )
      ));
   }

}

